From: Jonas Dreßler Date: Wed, 25 Apr 2018 20:14:57 +0000 (+0200) Subject: switcherPopup: Use this._highlighted to check for reentrancy X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~772^2^2~31 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=5c8f3a65f79a2e5a10c388ce3fc3c61441e7084e;p=gnome-shell.git switcherPopup: Use this._highlighted to check for reentrancy Since this._highlighted is always set to the currently highlighted index, there's no need to save the index to a separate variable. This obviously depends on getting the new item highlighted as a result of the item-entered event. This fixes bugs in situations where the highlighted element changes after an event that is not calling _onItemEnter, for example after scrolling or pressing a key. In those cases the _currentItemEntered variable wouldn't be updated and the old item couldn't be entered anymore without entering another one before. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167 --- diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js index d1322106e..d026453ca 100644 --- a/js/ui/switcherPopup.js +++ b/js/ui/switcherPopup.js @@ -440,10 +440,9 @@ var SwitcherList = GObject.registerClass({ _onItemEnter(index) { // Avoid reentrancy - if (index != this._currentItemEntered) { - this._currentItemEntered = index; + if (index !== this._highlighted) this._itemEntered(index); - } + return Clutter.EVENT_PROPAGATE; }